import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
Vue.use(ElementUI)
import 'element-ui/lib/theme-chalk/index.css';
// import './store/uiModules' //模块化 按需引入element-ui组件库
// 引入svg
Vue.config.productionTip = false
Vue.prototype.resetSetItem = function (key, newVal) {//实时监听StorageEvent事件
  // 创建一个StorageEvent事件
  var newStorageEvent = document.createEvent('StorageEvent');
  const storage = {
    setItem: function (k, val) {
      sessionStorage.setItem(k, val);
      // 初始化创建的事件
      newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null);
      // 派发对象
      window.dispatchEvent(newStorageEvent)
    }
  }
  return storage.setItem(key, newVal);
}

import '@/permission' // permission control
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
